package modele;

import java.util.ArrayList;

public class SequentialScheduler extends Scheduler {

	int index;

	public SequentialScheduler() {
		this.list = new ArrayList<Action>();
		this.index = 0;
	}

	@Override
	public boolean isReady() {
		return list.get(index).isReady();
	}

	@Override
	public boolean isFinished() {
		return (index == list.size());
	}

	@Override
	public void reallyDoStep() {
		if (!isFinished()) {
			list.get(index).doStep();
		}
		if (list.get(index).isFinished())
			index = index + 1;
	}

}
